package com.lewis.anf.websocket;

import org.eclipse.jetty.websocket.WebSocket.OnTextMessage;

import com.lewis.anf.servlet.InitWebSocketServlet;

public class AnfWebSocket implements OnTextMessage {

	private Connection connection; 
	
	@Override
	public void onOpen(Connection connection) {
		this.connection = connection;  
		InitWebSocketServlet.getSocketList().add(this);  
	}

	@Override
	public void onClose(int closeCode, String message) {
		InitWebSocketServlet.getSocketList().remove(this);  
	}

	@Override
	public void onMessage(String data) {
		System.out.println("send the hell out of it");

	}

	public Connection getConnection() {
		return connection;
	}

	public void setConnection(Connection connection) {
		this.connection = connection;
	}
	
}
